package com.kkwrite.regimen.common.constant;

/**
 * 订单状态枚举
 *
 * @author Soosky Wang
 * @version 1.0.0
 * @date 2018年7月23日 下午9:35:46
 */
public enum OrderStatusEnum {
	/**
	 * 待支付
	 */
	UNPAID("待支付", (short) 1),
	/**
	 * 待消费
	 */
	UNCONSUME("待消费", (short) 2),
	/**
	 * 已完成
	 */
	COMPLETED("已完成", (short) 3),
	/**
	 * 已取消
	 */
	CANCELED("已取消", (short) 4);

	private String status;
	private Short statusValue;

	OrderStatusEnum(String status, Short statusValue) {
		this.status = status;
		this.statusValue = statusValue;
	}

	public String getStatus() {
		return status;
	}

	public Short getStatusValue() {
		return statusValue;
	}

	public static String findOrderStatusDesc(short value) {
		for (OrderStatusEnum statusEnum : OrderStatusEnum.values()) {
			if (statusEnum.statusValue == value) {
				return statusEnum.status;
			}
		}
		return null;
	}

	public enum PayStatusEnum {
		/**
		 * 未支付
		 */
		UNPAID((short) 0),
		/**
		 * 已支付
		 */
		PAID((short) 1);
		private Short payStatus;

		PayStatusEnum(Short payStatus) {
			this.payStatus = payStatus;
		}

		public Short getPayStatus() {
			return payStatus;
		}
	}

	public enum IsRefund {
		/**
		 * 退款标识-否
		 */
		IS_REFUND_NO((short) 0),
		/**
		 * 退款标识-是
		 */
		IS_REFUND_YES((short) 1);
		private Short status;

		IsRefund(Short status) {
			this.status = status;
		}

		public Short getStatus() {
			return status;
		}
	}

	public enum RefundStatus {
		/**
		 * 待退款
		 */
		PENDING_REFUND((short) 1),
		/**
		 * 已退款
		 */
		REFUNDED((short) 2);
		private Short status;

		RefundStatus(Short status) {
			this.status = status;
		}

		public Short getStatus() {
			return status;
		}

	}

	public enum IsReviewed {
		/**
		 * 已评价
		 */
		YES(2),
		/**
		 * 未评价
		 */
		NO(1);
		private Integer status;

		IsReviewed(Integer status) {
			this.status = status;
		}

		public Integer getStatus() {
			return status;
		}
	}

	public enum ReviewSourceEnum {
		/**
		 * 店铺商家
		 */
		SHOP(2),
		/**
		 * 用户
		 */
		USER(1);

		private Integer source;

		public Integer getSource() {
			return source;
		}

		ReviewSourceEnum(Integer source) {
			this.source = source;
		}
	}

	public enum OrderType {
		/**
		 * 项目订单类型
		 */
		ITEM_ORDER_TYPE((short) 1),
		
		/**
		 * 套餐订单类型
		 */
		COMBO_ORDER_TYPE((short) 2),
		
		/**
		 * 活动订单类型
		 */
		ACTIVITY_ORDER_TYPE((short) 3);

		private Short orderType;

		OrderType(Short orderType) {
			this.orderType = orderType;
		}

		public Short getOrderType() {
			return orderType;
		}

	}

	/**
	 * 微信交易状态
	 *
	 * @author lisha
	 */
	public enum WechatTradeState {
		/**
		 * 支付成功
		 */
		SUCCESS,
		/**
		 * 转入退款
		 */
		REFUND,
		/**
		 * 未支付
		 */
		NOTPAY,
		/**
		 * 已关闭
		 */
		CLOSED,
		/**
		 * 已撤销（刷卡支付）
		 */
		REVOKED,
		/**
		 * 用户支付中
		 */
		USERPAYING,
		/**
		 * 支付失败(其他原因，如银行返回失败)
		 */
		PAYERROR
	}

}
